@import 'compass/css3';
@import 'utils/module';

.Menu {
    .MenuItem {
        font-size: 14px;
        display: flex;
        align-items: center;

        &.MenuItem--with-icon {
            .MenuItem__help-text {
                padding-left: 28px;
            }
        }

        .MenuItem__icon {
            text-align: center;
            width: 20px;
            margin-right: 8px;
        }

        span.icon {
            width: 28px; // less 12px padding is 16px
            height: 16px; // less 3px top padding is 16px;
            padding-right: 12px;
            line-height: 16px;
            display: inline-block;
            align-self: center;
        }

        span.MenuItem__primary-text {
            display: inline-flex;
            white-space: normal;
            line-height: 22px;
            padding: 5px 0;
        }

        span.MenuItem__help-text {
            @include opacity(.7);
            display: block;
            font-size: 12px;
            line-height: 16px;
            white-space: normal;
            padding-bottom: 8px;

            @media (max-width: 768px) {
                margin: 0 0px 4px 38px;
            }
        }

        > a {
            text-decoration: none;

            &:focus,
            &:hover {
                color: inherit;
            }
        }

        > div {
            padding-left: 0px !important;
            &:hover,
            &:focus {
                background-color: var(--center-channel-color-08) !important;
            }
        }

        > div,
        > button,
        > a {
            align-items: center;
            clear: both;
            color: inherit;
            cursor: pointer;
            display: block;
            font-weight: normal;
            padding: 0 32px 0 24px;
            text-align: left;
            white-space: nowrap;
            width: 100%;
            overflow: hidden;
            text-overflow: ellipsis;
            line-height: 28px;

            &.MenuItem__with-help {
                height: auto;
                padding: 0 24px;

                .MenuItem__primary-text {
                    padding: 7px 0 3px;
                }

                .icon {
                    @media (max-width: 768px) {
                        top: 10px;
                        position: relative;
                    }
                }
            }

            .MenuItem__icon {
                width: 20px;
                height: 20px;
                display: inline-flex;
                align-items: center;
                justify-content: center;
                margin-right: 8px;
                top: 4px;
                position: relative;
            }

            &:hover {
                background: alpha-color($black, .08);
            }

            &.MenuItem__dangerous {
                color: var(--dnd-indicator);

                i {
                    color: var(--dnd-indicator) !important;
                }

                &:hover {
                    background-color: var(--dnd-indicator) !important;
                    color: var(--sidebar-text);

                    i {
                        color: var(--sidebar-text) !important;
                    }
                }
            }
        }
    }
}

.SubMenu {
    padding-left: 0px;
    position: absolute;
    top: unset;
    left: unset;
}

.SubMenu__icon-left {
    color: inherit;
    font-size: 19px;
    padding: 0 8px 0 9px;
    position: relative;
    top: 0;
}

.SubMenu__icon-left-empty {
    visibility: hidden;
    font-size: 19px;
    padding: 0 8px 0 9px;
    position: relative;
    top: 0;
    width: 0;

    &.mobile {
        padding: 0 4px 0 9px;
    }
}

.SubMenu__icon-right {
    color: inherit;
    font-size: 19px;
    padding: 4px 9px 0 8px;
    margin-left: auto;
    top: 0;
    float: right;
}

.SubMenu__icon-right-empty {
    visibility: hidden;
    font-size: 19px;
    padding: 0;
    margin-left: auto;
    width: 0;
    top: 0;
}

.MenuItem__divider {
    margin: 8px 0;
    border-top: $border-gray;
}
